Various aspects of the present invention relate generally to virtual machines, and more particularly, to the efficient transfer of objects between virtual machines.
A virtual machine is a software representation of a physical machine that provides resources and abstractions to software running within the virtual machine. A virtual machine may be implemented as a “system” virtual machine, which can be used to create a virtual environment in which an operating system, programs and/other software can execute as if the software were being executed on a conventional physical machine. A virtual machine may also be implemented as a “process” virtual machine, which can be used to create a virtual environment that supports a single application or process.
A virtual machine is software, and must therefore run on a physical machine. However, a single physical machine may host multiple virtual machines. When a virtual machine is started, the underlying physical machine allocates memory resources, called a heap to the virtual machine. As such, each virtual machine has a unique, reserved memory space within the memory of the host physical machine. Examples of virtual machines include, but are not limited to, Java virtual machine, Parrot, CPython, and the Perl virtual machine.
Object-oriented programming is a programming paradigm that facilitates application development utilizing data structures to represent bundled state and behavior information as objects. In object-oriented programming, classes are used to define the types of objects available to an application. Basically, a class is a template on which objects are based. An object is created (instantiated) from a class, and thus represents a specific instance of the class from which the object is instantiated. Each object stores variables, sometimes called fields or attributes, which are used to represent the state of the object. Each object also stores methods, sometimes called functions, which are used to represent the behavior of the object. In the context of object oriented processing using virtual machines, the classes and/or objects necessary to an application executing in a virtual machine are stored in the virtual machine's heap.